3.2.9 \(\int \frac {(c+d x)^2}{a+i a \sinh (e+f x)} \, dx\) [109]

3.2.9.1 Optimal result
3.2.9.2 Mathematica [A] (verified)
3.2.9.3 Rubi [A] (verified)
3.2.9.4 Maple [B] (verified)
3.2.9.5 Fricas [B] (verification not implemented)
3.2.9.6 Sympy [F]
3.2.9.7 Maxima [F]
3.2.9.8 Giac [F]
3.2.9.9 Mupad [F(-1)]

3.2.9.1 Optimal result

Integrand size = 23, antiderivative size = 101 \[ \int \frac {(c+d x)^2}{a+i a \sinh (e+f x)} \, dx=\frac {(c+d x)^2}{a f}-\frac {4 d (c+d x) \log \left (1+i e^{e+f x}\right )}{a f^2}-\frac {4 d^2 \operatorname {PolyLog}\left (2,-i e^{e+f x}\right )}{a f^3}+\frac {(c+d x)^2 \tanh \left (\frac {e}{2}+\frac {i \pi }{4}+\frac {f x}{2}\right )}{a f} \]

output
(d*x+c)^2/a/f-4*d*(d*x+c)*ln(1+I*exp(f*x+e))/a/f^2-4*d^2*polylog(2,-I*exp( 
f*x+e))/a/f^3+(d*x+c)^2*tanh(1/2*e+1/4*I*Pi+1/2*f*x)/a/f
 
3.2.9.2 Mathematica [A] (verified)

Time = 0.72 (sec) , antiderivative size = 152, normalized size of antiderivative = 1.50 \[ \int \frac {(c+d x)^2}{a+i a \sinh (e+f x)} \, dx=\frac {2 \left (\frac {\frac {i f (c+d x) \left (f (c+d x)+2 d \left (1+i e^e\right ) \log \left (1-i e^{-e-f x}\right )\right )}{-i+e^e}+2 d^2 \operatorname {PolyLog}\left (2,i e^{-e-f x}\right )}{f^2}+\frac {(c+d x)^2 \sinh \left (\frac {f x}{2}\right )}{\left (\cosh \left (\frac {e}{2}\right )+i \sinh \left (\frac {e}{2}\right )\right ) \left (\cosh \left (\frac {1}{2} (e+f x)\right )+i \sinh \left (\frac {1}{2} (e+f x)\right )\right )}\right )}{a f} \]

input
Integrate[(c + d*x)^2/(a + I*a*Sinh[e + f*x]),x]
 
output
(2*(((I*f*(c + d*x)*(f*(c + d*x) + 2*d*(1 + I*E^e)*Log[1 - I*E^(-e - f*x)] 
))/(-I + E^e) + 2*d^2*PolyLog[2, I*E^(-e - f*x)])/f^2 + ((c + d*x)^2*Sinh[ 
(f*x)/2])/((Cosh[e/2] + I*Sinh[e/2])*(Cosh[(e + f*x)/2] + I*Sinh[(e + f*x) 
/2]))))/(a*f)
 
3.2.9.3 Rubi [A] (verified)

Time = 0.60 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.14, number of steps used = 15, number of rules used = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.609, Rules used = {3042, 3799, 25, 25, 3042, 4672, 26, 3042, 26, 4199, 26, 2620, 2715, 2838}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {(c+d x)^2}{a+i a \sinh (e+f x)} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {(c+d x)^2}{a+a \sin (i e+i f x)}dx\)

\(\Big \downarrow \) 3799

\(\displaystyle \frac {\int -(c+d x)^2 \text {csch}^2\left (\frac {e}{2}+\frac {f x}{2}-\frac {i \pi }{4}\right )dx}{2 a}\)

\(\Big \downarrow \) 25

\(\displaystyle -\frac {\int -(c+d x)^2 \text {sech}^2\left (\frac {e}{2}+\frac {f x}{2}+\frac {i \pi }{4}\right )dx}{2 a}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {\int (c+d x)^2 \text {sech}^2\left (\frac {e}{2}+\frac {f x}{2}+\frac {i \pi }{4}\right )dx}{2 a}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\int (c+d x)^2 \csc \left (\frac {i e}{2}+\frac {i f x}{2}+\frac {\pi }{4}\right )^2dx}{2 a}\)

\(\Big \downarrow \) 4672

\(\displaystyle \frac {\frac {2 (c+d x)^2 \tanh \left (\frac {e}{2}+\frac {f x}{2}+\frac {i \pi }{4}\right )}{f}-\frac {4 i d \int -i (c+d x) \tanh \left (\frac {e}{2}+\frac {f x}{2}+\frac {i \pi }{4}\right )dx}{f}}{2 a}\)

\(\Big \downarrow \) 26

\(\displaystyle \frac {\frac {2 (c+d x)^2 \tanh \left (\frac {e}{2}+\frac {f x}{2}+\frac {i \pi }{4}\right )}{f}-\frac {4 d \int (c+d x) \tanh \left (\frac {e}{2}+\frac {f x}{2}+\frac {i \pi }{4}\right )dx}{f}}{2 a}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {2 (c+d x)^2 \tanh \left (\frac {e}{2}+\frac {f x}{2}+\frac {i \pi }{4}\right )}{f}-\frac {4 d \int -i (c+d x) \tan \left (\frac {i e}{2}+\frac {i f x}{2}-\frac {\pi }{4}\right )dx}{f}}{2 a}\)

\(\Big \downarrow \) 26

\(\displaystyle \frac {\frac {4 i d \int (c+d x) \tan \left (\frac {i e}{2}+\frac {i f x}{2}-\frac {\pi }{4}\right )dx}{f}+\frac {2 (c+d x)^2 \tanh \left (\frac {e}{2}+\frac {f x}{2}+\frac {i \pi }{4}\right )}{f}}{2 a}\)

\(\Big \downarrow \) 4199

\(\displaystyle \frac {\frac {4 i d \left (2 i \int \frac {i e^{e+f x} (c+d x)}{1+i e^{e+f x}}dx-\frac {i (c+d x)^2}{2 d}\right )}{f}+\frac {2 (c+d x)^2 \tanh \left (\frac {e}{2}+\frac {f x}{2}+\frac {i \pi }{4}\right )}{f}}{2 a}\)

\(\Big \downarrow \) 26

\(\displaystyle \frac {\frac {4 i d \left (-2 \int \frac {e^{e+f x} (c+d x)}{1+i e^{e+f x}}dx-\frac {i (c+d x)^2}{2 d}\right )}{f}+\frac {2 (c+d x)^2 \tanh \left (\frac {e}{2}+\frac {f x}{2}+\frac {i \pi }{4}\right )}{f}}{2 a}\)

\(\Big \downarrow \) 2620

\(\displaystyle \frac {\frac {4 i d \left (-2 \left (\frac {i d \int \log \left (1+i e^{e+f x}\right )dx}{f}-\frac {i (c+d x) \log \left (1+i e^{e+f x}\right )}{f}\right )-\frac {i (c+d x)^2}{2 d}\right )}{f}+\frac {2 (c+d x)^2 \tanh \left (\frac {e}{2}+\frac {f x}{2}+\frac {i \pi }{4}\right )}{f}}{2 a}\)

\(\Big \downarrow \) 2715

\(\displaystyle \frac {\frac {4 i d \left (-2 \left (\frac {i d \int e^{-e-f x} \log \left (1+i e^{e+f x}\right )de^{e+f x}}{f^2}-\frac {i (c+d x) \log \left (1+i e^{e+f x}\right )}{f}\right )-\frac {i (c+d x)^2}{2 d}\right )}{f}+\frac {2 (c+d x)^2 \tanh \left (\frac {e}{2}+\frac {f x}{2}+\frac {i \pi }{4}\right )}{f}}{2 a}\)

\(\Big \downarrow \) 2838

\(\displaystyle \frac {\frac {4 i d \left (-2 \left (-\frac {i (c+d x) \log \left (1+i e^{e+f x}\right )}{f}-\frac {i d \operatorname {PolyLog}\left (2,-i e^{e+f x}\right )}{f^2}\right )-\frac {i (c+d x)^2}{2 d}\right )}{f}+\frac {2 (c+d x)^2 \tanh \left (\frac {e}{2}+\frac {f x}{2}+\frac {i \pi }{4}\right )}{f}}{2 a}\)

input
Int[(c + d*x)^2/(a + I*a*Sinh[e + f*x]),x]
 
output
(((4*I)*d*(((-1/2*I)*(c + d*x)^2)/d - 2*(((-I)*(c + d*x)*Log[1 + I*E^(e + 
f*x)])/f - (I*d*PolyLog[2, (-I)*E^(e + f*x)])/f^2)))/f + (2*(c + d*x)^2*Ta 
nh[e/2 + (I/4)*Pi + (f*x)/2])/f)/(2*a)
 

3.2.9.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 26
Int[(Complex[0, a_])*(Fx_), x_Symbol] :> Simp[(Complex[Identity[0], a])   I 
nt[Fx, x], x] /; FreeQ[a, x] && EqQ[a^2, 1]
 

rule 2620
Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/ 
((a_) + (b_.)*((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp 
[((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x] - Si 
mp[d*(m/(b*f*g*n*Log[F]))   Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x 
)))^n/a)], x], x] /; FreeQ[{F, a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]
 

rule 2715
Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] 
:> Simp[1/(d*e*n*Log[F])   Subst[Int[Log[a + b*x]/x, x], x, (F^(e*(c + d*x) 
))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]
 

rule 2838
Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2 
, (-c)*e*x^n]/n, x] /; FreeQ[{c, d, e, n}, x] && EqQ[c*d, 1]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3799
Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_.) 
, x_Symbol] :> Simp[(2*a)^n   Int[(c + d*x)^m*Sin[(1/2)*(e + Pi*(a/(2*b))) 
+ f*(x/2)]^(2*n), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && EqQ[a^2 - b^ 
2, 0] && IntegerQ[n] && (GtQ[n, 0] || IGtQ[m, 0])
 

rule 4199
Int[((c_.) + (d_.)*(x_))^(m_.)*tan[(e_.) + Pi*(k_.) + (Complex[0, fz_])*(f_ 
.)*(x_)], x_Symbol] :> Simp[(-I)*((c + d*x)^(m + 1)/(d*(m + 1))), x] + Simp 
[2*I   Int[((c + d*x)^m*(E^(2*((-I)*e + f*fz*x))/(1 + E^(2*((-I)*e + f*fz*x 
))/E^(2*I*k*Pi))))/E^(2*I*k*Pi), x], x] /; FreeQ[{c, d, e, f, fz}, x] && In 
tegerQ[4*k] && IGtQ[m, 0]
 

rule 4672
Int[csc[(e_.) + (f_.)*(x_)]^2*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp 
[(-(c + d*x)^m)*(Cot[e + f*x]/f), x] + Simp[d*(m/f)   Int[(c + d*x)^(m - 1) 
*Cot[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]
 
3.2.9.4 Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 226 vs. \(2 (90 ) = 180\).

Time = 1.34 (sec) , antiderivative size = 227, normalized size of antiderivative = 2.25

method result size
risch \(\frac {2 i \left (d^{2} x^{2}+2 c d x +c^{2}\right )}{f a \left ({\mathrm e}^{f x +e}-i\right )}-\frac {4 d \ln \left ({\mathrm e}^{f x +e}-i\right ) c}{a \,f^{2}}+\frac {4 d \ln \left ({\mathrm e}^{f x +e}\right ) c}{a \,f^{2}}+\frac {2 d^{2} x^{2}}{a f}+\frac {4 d^{2} e x}{a \,f^{2}}+\frac {2 d^{2} e^{2}}{a \,f^{3}}-\frac {4 d^{2} \ln \left (1+i {\mathrm e}^{f x +e}\right ) x}{a \,f^{2}}-\frac {4 d^{2} \ln \left (1+i {\mathrm e}^{f x +e}\right ) e}{a \,f^{3}}-\frac {4 d^{2} \operatorname {polylog}\left (2, -i {\mathrm e}^{f x +e}\right )}{a \,f^{3}}+\frac {4 d^{2} e \ln \left ({\mathrm e}^{f x +e}-i\right )}{a \,f^{3}}-\frac {4 d^{2} e \ln \left ({\mathrm e}^{f x +e}\right )}{a \,f^{3}}\) \(227\)

input
int((d*x+c)^2/(a+I*a*sinh(f*x+e)),x,method=_RETURNVERBOSE)
 
output
2*I*(d^2*x^2+2*c*d*x+c^2)/f/a/(exp(f*x+e)-I)-4/a/f^2*d*ln(exp(f*x+e)-I)*c+ 
4/a/f^2*d*ln(exp(f*x+e))*c+2/a/f*d^2*x^2+4/a/f^2*d^2*e*x+2/a/f^3*d^2*e^2-4 
/a/f^2*d^2*ln(1+I*exp(f*x+e))*x-4/a/f^3*d^2*ln(1+I*exp(f*x+e))*e-4*d^2*pol 
ylog(2,-I*exp(f*x+e))/a/f^3+4/a/f^3*d^2*e*ln(exp(f*x+e)-I)-4/a/f^3*d^2*e*l 
n(exp(f*x+e))
 
3.2.9.5 Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 201 vs. \(2 (86) = 172\).

Time = 0.24 (sec) , antiderivative size = 201, normalized size of antiderivative = 1.99 \[ \int \frac {(c+d x)^2}{a+i a \sinh (e+f x)} \, dx=-\frac {2 \, {\left (-i \, d^{2} e^{2} + 2 i \, c d e f - i \, c^{2} f^{2} + 2 \, {\left (d^{2} e^{\left (f x + e\right )} - i \, d^{2}\right )} {\rm Li}_2\left (-i \, e^{\left (f x + e\right )}\right ) - {\left (d^{2} f^{2} x^{2} + 2 \, c d f^{2} x - d^{2} e^{2} + 2 \, c d e f\right )} e^{\left (f x + e\right )} + 2 \, {\left (i \, d^{2} e - i \, c d f - {\left (d^{2} e - c d f\right )} e^{\left (f x + e\right )}\right )} \log \left (e^{\left (f x + e\right )} - i\right ) + 2 \, {\left (-i \, d^{2} f x - i \, d^{2} e + {\left (d^{2} f x + d^{2} e\right )} e^{\left (f x + e\right )}\right )} \log \left (i \, e^{\left (f x + e\right )} + 1\right )\right )}}{a f^{3} e^{\left (f x + e\right )} - i \, a f^{3}} \]

input
integrate((d*x+c)^2/(a+I*a*sinh(f*x+e)),x, algorithm="fricas")
 
output
-2*(-I*d^2*e^2 + 2*I*c*d*e*f - I*c^2*f^2 + 2*(d^2*e^(f*x + e) - I*d^2)*dil 
og(-I*e^(f*x + e)) - (d^2*f^2*x^2 + 2*c*d*f^2*x - d^2*e^2 + 2*c*d*e*f)*e^( 
f*x + e) + 2*(I*d^2*e - I*c*d*f - (d^2*e - c*d*f)*e^(f*x + e))*log(e^(f*x 
+ e) - I) + 2*(-I*d^2*f*x - I*d^2*e + (d^2*f*x + d^2*e)*e^(f*x + e))*log(I 
*e^(f*x + e) + 1))/(a*f^3*e^(f*x + e) - I*a*f^3)
 
3.2.9.6 Sympy [F]

\[ \int \frac {(c+d x)^2}{a+i a \sinh (e+f x)} \, dx=\frac {2 i c^{2} + 4 i c d x + 2 i d^{2} x^{2}}{a f e^{e} e^{f x} - i a f} - \frac {4 i d \left (\int \frac {c}{e^{e} e^{f x} - i}\, dx + \int \frac {d x}{e^{e} e^{f x} - i}\, dx\right )}{a f} \]

input
integrate((d*x+c)**2/(a+I*a*sinh(f*x+e)),x)
 
output
(2*I*c**2 + 4*I*c*d*x + 2*I*d**2*x**2)/(a*f*exp(e)*exp(f*x) - I*a*f) - 4*I 
*d*(Integral(c/(exp(e)*exp(f*x) - I), x) + Integral(d*x/(exp(e)*exp(f*x) - 
 I), x))/(a*f)
 
3.2.9.7 Maxima [F]

\[ \int \frac {(c+d x)^2}{a+i a \sinh (e+f x)} \, dx=\int { \frac {{\left (d x + c\right )}^{2}}{i \, a \sinh \left (f x + e\right ) + a} \,d x } \]

input
integrate((d*x+c)^2/(a+I*a*sinh(f*x+e)),x, algorithm="maxima")
 
output
-2*d^2*(-I*x^2/(a*f*e^(f*x + e) - I*a*f) + 2*I*integrate(x/(a*f*e^(f*x + e 
) - I*a*f), x)) + 4*c*d*(x*e^(f*x + e)/(a*f*e^(f*x + e) - I*a*f) - log((e^ 
(f*x + e) - I)*e^(-e))/(a*f^2)) - 2*c^2/((I*a*e^(-f*x - e) - a)*f)
 
3.2.9.8 Giac [F]

\[ \int \frac {(c+d x)^2}{a+i a \sinh (e+f x)} \, dx=\int { \frac {{\left (d x + c\right )}^{2}}{i \, a \sinh \left (f x + e\right ) + a} \,d x } \]

input
integrate((d*x+c)^2/(a+I*a*sinh(f*x+e)),x, algorithm="giac")
 
output
integrate((d*x + c)^2/(I*a*sinh(f*x + e) + a), x)
 
3.2.9.9 Mupad [F(-1)]

Timed out. \[ \int \frac {(c+d x)^2}{a+i a \sinh (e+f x)} \, dx=\int \frac {{\left (c+d\,x\right )}^2}{a+a\,\mathrm {sinh}\left (e+f\,x\right )\,1{}\mathrm {i}} \,d x \]

input
int((c + d*x)^2/(a + a*sinh(e + f*x)*1i),x)
 
output
int((c + d*x)^2/(a + a*sinh(e + f*x)*1i), x)